[id].vue 62 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923
  1. <template>
  2. <div>
  3. <!-- 页面头部 -->
  4. <HomePageHead></HomePageHead>
  5. <!-- 页面导航 -->
  6. <HomePageNavigation></HomePageNavigation>
  7. <!-- 二级标题-->
  8. <HomeSecondaryHeading :titleName="routeName" :titleData="pageCategory"></HomeSecondaryHeading>
  9. <!-- {{ name }} -->
  10. <!-- 第一层 -->
  11. <div class="farmingPartOne">
  12. <div class="inner">
  13. <div class="innerLeft" v-if="pageData.length>=1">
  14. <!-- 标题部分 -->
  15. <div class="title">
  16. <h3>
  17. {{pageData[0].title}}
  18. <span>查看更多</span>
  19. </h3>
  20. </div>
  21. <div class="leftTop">
  22. <div class="leftTopPhoto left">
  23. <!--当pageData[0].data[0]存在的时候才渲染,如果直接渲染会导致页面找不到属性-->
  24. <img :src="pageData[0].data[0].imgurl" v-if="pageData[0].data[0]">
  25. <span></span>
  26. </div>
  27. <ul class="left">
  28. <li v-for="item in pageData[0].data">
  29. <em></em>
  30. {{item.title}}
  31. </li>
  32. </ul>
  33. </div>
  34. <ul class="leftBottom">
  35. <li v-for="item in pageData[0].data2">
  36. <img :src="item.imgurl">
  37. <p>{{item.title}}</p>
  38. </li>
  39. </ul>
  40. </div>
  41. <div class="innerRight" v-if="pageData.length>=2">
  42. <!-- 标题部分 -->
  43. <div class="title">
  44. <h3>
  45. {{pageData[1].title}}
  46. <span>查看更多</span>
  47. </h3>
  48. </div>
  49. <!-- 列表 -->
  50. <ul class="rightList">
  51. <li v-for="item in pageData[1].data">
  52. <img class="left" :src="item.imgurl">
  53. <p class="left">{{item.title}}</p>
  54. </li>
  55. </ul>
  56. </div>
  57. </div>
  58. </div>
  59. <!-- 三农资讯logo -->
  60. <HomeSannongzixun></HomeSannongzixun>
  61. <!-- 第二层 -->
  62. <div class="farmingPartTwo">
  63. <div class="inner">
  64. <div class="farmer" v-if="pageData.length>=3">
  65. <!-- 标题部分 -->
  66. <div class="title">
  67. <h3>
  68. {{pageData[2].title}}
  69. <span>查看更多</span>
  70. </h3>
  71. </div>
  72. <div class="PartTwoPhoto" v-if="pageData[2].data[0]">
  73. <img :src="pageData[2].data[0].imgurl">
  74. <span>{{ pageData[2].data[0].title }}</span>
  75. </div>
  76. <ul class="PartTwoList">
  77. <li v-for="item in pageData[2].data">
  78. <em></em>
  79. {{item.title}}
  80. </li>
  81. </ul>
  82. </div>
  83. <div class="farmer" v-if="pageData.length>=4">
  84. <!-- 标题部分 -->
  85. <div class="title">
  86. <h3>
  87. {{pageData[3].title}}
  88. <span>查看更多</span>
  89. </h3>
  90. </div>
  91. <div class="PartTwoPhoto" v-if="pageData[3].data[0]">
  92. <img :src="pageData[3].data[0].imgurl">
  93. <span>{{ pageData[3].data[0].title }}</span>
  94. </div>
  95. <ul class="PartTwoList">
  96. <li v-for="item in pageData[3].data">
  97. <em></em>
  98. {{item.title}}
  99. </li>
  100. </ul>
  101. </div>
  102. <div class="farmer" v-if="pageData.length>=5">
  103. <!-- 标题部分 -->
  104. <div class="title">
  105. <h3>
  106. {{pageData[4].title}}
  107. <span>查看更多</span>
  108. </h3>
  109. </div>
  110. <div class="PartTwoPhoto" v-if="pageData[4].data[0]">
  111. <img :src="pageData[4].data[0].imgurl">
  112. <span>{{ pageData[4].data[0].title }}</span>
  113. </div>
  114. <ul class="PartTwoList">
  115. <li v-for="item in pageData[4].data">
  116. <em></em>
  117. {{item.title}}
  118. </li>
  119. </ul>
  120. </div>
  121. </div>
  122. </div>
  123. <!-- 三农资讯logo -->
  124. <HomeSannongzixun></HomeSannongzixun>
  125. <!-- 第三层 -->
  126. <div class="zixuntuijian">
  127. <div class="inner">
  128. <div class="innerLeft">
  129. <div class="zixunTop">
  130. <div class="zixunLeft">
  131. <!-- 标题部分 -->
  132. <div class="title">
  133. <h3>
  134. {{pageData[5].title}}
  135. <span>查看更多</span>
  136. </h3>
  137. </div>
  138. <!-- 图片和文字列表 160 -->
  139. <ul class="photo_text">
  140. <li v-for="(item,index) in pageData[5].data">
  141. <article v-if="index==0">
  142. <img :src="item.imgurl" alt="">
  143. <div>
  144. <h5>{{item.title}}</h5>
  145. <p>
  146. <span>{{ item.author }}</span>
  147. <span>{{item.created_at}}</span>
  148. </p>
  149. </div>
  150. </article>
  151. <article v-else>
  152. <em></em>
  153. {{item.title}}
  154. </article>
  155. </li>
  156. </ul>
  157. </div>
  158. <div class="zixunRight">
  159. <!-- 标题部分 -->
  160. <div class="title">
  161. <h3>
  162. {{pageData[6].title}}
  163. <span>查看更多</span>
  164. </h3>
  165. </div>
  166. <div class="towPic">
  167. <div v-for="(item,index) in pageData[6].data" class="picBox">
  168. <div v-if="index<=1">
  169. <img :src="item.imgurl">
  170. </div>
  171. </div>
  172. </div>
  173. <!-- 图片和文字列表 -->
  174. <ul class="photo_text">
  175. <li v-for="(item,index) in pageData[6].data">
  176. <article v-if="index>1">
  177. <em></em>
  178. {{item.title}}
  179. </article>
  180. </li>
  181. </ul>
  182. </div>
  183. </div>
  184. <div class="zixunBottom">
  185. <img class="left" :src="pageData[7].data[0].imgurl" v-if="pageData[7].data[0]">
  186. <ul class="leftList left">
  187. <li v-for="item in pageData[7].data">
  188. <h4>
  189. <em></em>
  190. {{item.title}}
  191. </h4>
  192. <p>{{item.title}}</p>
  193. </li>
  194. </ul>
  195. </div>
  196. </div>
  197. <div class="innerRight">
  198. <!-- 标题部分 -->
  199. <div class="title">
  200. <h3>
  201. {{pageData[8].title}}
  202. <span>查看更多</span>
  203. </h3>
  204. </div>
  205. <ul class="information">
  206. <li v-for="item in pageData[8].data">
  207. <img :src="item.imgurl">
  208. <div class="text">
  209. <h5>{{item.title}}</h5>
  210. <p>{{item.introduce}}</p>
  211. </div>
  212. </li>
  213. </ul>
  214. </div>
  215. </div>
  216. </div>
  217. <!-- 十强称号logo -->
  218. <HomeTopTen></HomeTopTen>
  219. <!-- 第四层 -->
  220. <div class="farming">
  221. <div class="inner">
  222. <div class="innerLeft">
  223. <div class="farmer">
  224. <h3>
  225. {{pageData[9].title}}
  226. <span>查看更多</span>
  227. </h3>
  228. <ul>
  229. <li v-for="item in pageData[9].data">
  230. <em></em>
  231. <span>{{ item.title }}</span>
  232. </li>
  233. </ul>
  234. </div>
  235. <div class="farmer">
  236. <h3>
  237. {{pageData[10].title}}
  238. <span>查看更多</span>
  239. </h3>
  240. <ul>
  241. <li v-for="item in pageData[10].data">
  242. <em></em>
  243. <span>{{ item.title }}</span>
  244. </li>
  245. </ul>
  246. </div>
  247. </div>
  248. <div class="innerRight">
  249. <!-- 标题部分 -->
  250. <h3>
  251. {{ pageData[11].title }}
  252. <span>查看更多</span>
  253. </h3>
  254. <!-- 轮播图 -->
  255. <div class="banner">
  256. <HomeSmallSwiper :swiperData="pageData[11].data"></HomeSmallSwiper>
  257. </div>
  258. <!-- 轮播图下小图列表 及内容列表 -->
  259. <div class="banner_b_img">
  260. <div class="photo">
  261. <article v-for="(item,index) in pageData[11].data2">
  262. <div class="photoL" v-if="index==0">
  263. <img :src="item.imgurl">
  264. <span>{{item.title}}</span>
  265. </div>
  266. <div class="photoL" v-if="index==1">
  267. <img :src="item.imgurl">
  268. <span>{{item.title}}</span>
  269. </div>
  270. </article>
  271. </div>
  272. </div>
  273. <div class="banner_text_list">
  274. <ul>
  275. <li v-for="item in pageData[11].data3">
  276. <em></em>
  277. <span>{{item.title}}</span>
  278. </li>
  279. </ul>
  280. </div>
  281. </div>
  282. </div>
  283. </div>
  284. <!-- 十强称号logo -->
  285. <HomeTopTenTitle></HomeTopTenTitle>
  286. <!-- 第五层 -->
  287. <div class="scienceEducation">
  288. <div class="inner">
  289. <!-- 左侧 -->
  290. <div class="innerLeft">
  291. <!-- <HomeSlider ></HomeSlider> -->
  292. <div class="slider">
  293. <!-- 标题部分 -->
  294. <div class="scienceTitle">
  295. <h5>{{ pageData[12].title }}</h5>
  296. <p class="title">
  297. <span v-if="pageData[12]" @click="qhtabs(1)">{{ pageData[12].title1}}</span>
  298. <span v-if="pageData[12]" @click="qhtabs(2)">{{ pageData[12].title2}}</span>
  299. <span v-if="pageData[12]" @click="qhtabs(3)">{{ pageData[12].title3}}</span>
  300. <span v-if="pageData[12]" @click="qhtabs(4)">{{ pageData[12].title4}}</span>
  301. </p>
  302. </div>
  303. <!-- 标题下内容列表 -->
  304. <div class="box">
  305. <div class="scienceListBox">
  306. <ul class="scienceList" v-if="showTabs==1">
  307. <li v-for="item in pageData[12].data1">
  308. <img :src="item.imgurl">
  309. <p>{{item.title}}</p>
  310. </li>
  311. </ul>
  312. <ul class="scienceList" v-if="showTabs==2">
  313. <li v-for="item in pageData[12].data2">
  314. <img :src="item.imgurl">
  315. <p>{{item.title}}</p>
  316. </li>
  317. </ul>
  318. <ul class="scienceList" v-if="showTabs==3">
  319. <li v-for="item in pageData[12].data3">
  320. <img :src="item.imgurl">
  321. <p>{{item.title}}</p>
  322. </li>
  323. </ul>
  324. <ul class="scienceList" v-if="showTabs==4">
  325. <li v-for="item in pageData[12].data4">
  326. <img :src="item.imgurl">
  327. <p>{{item.title}}</p>
  328. </li>
  329. </ul>
  330. </div>
  331. </div>
  332. </div>
  333. </div>
  334. <!-- 右侧 -->
  335. <div class="innerRight">
  336. <!-- 标题部分 -->
  337. <h3>
  338. {{pageData[13].title}}
  339. <span>查看更多</span>
  340. </h3>
  341. <ul class="sannongList">
  342. <li v-for="item in pageData[13].data3">
  343. <em></em>
  344. <span>{{item.title}}</span>
  345. </li>
  346. </ul>
  347. <!-- 轮播图 -->
  348. <div class="banner">
  349. <HomeSmallSwiper :swiperData="pageData[13].data"></HomeSmallSwiper>
  350. </div>
  351. <!-- 轮播图下小图列表 及内容列表 -->
  352. <div class="banner_b_img">
  353. <div class="photo">
  354. <article v-for="(item,index) in pageData[13].data2">
  355. <div class="photoL" v-if="index==0">
  356. <img :src="item.imgurl">
  357. <span>{{item.title}}</span>
  358. </div>
  359. <div class="photoL" v-if="index==1">
  360. <img :src="item.imgurl">
  361. <span>{{item.title}}</span>
  362. </div>
  363. </article>
  364. </div>
  365. </div>
  366. </div>
  367. </div>
  368. </div>
  369. <!-- 页脚部分 -->
  370. <HomeFoot></HomeFoot>
  371. </div>
  372. </template>
  373. <script setup>
  374. //获取生命周期
  375. import { onMounted } from 'vue';
  376. //获得跳转过来的id
  377. const route = useRoute();
  378. const routeId = route.params.id; //获得该页面的id
  379. const routeName = route.query.name; //获得该页面的名称
  380. //获得axios
  381. const nuxtApp = useNuxtApp();
  382. const axios = nuxtApp.$axios;
  383. //该页面上所有的导航池 转为动态数据
  384. const pageCategory = ref([]);
  385. //该页面上需要渲染的所有数据
  386. const pageData = ref([
  387. {id:0,data:[],data2:[],title:""},
  388. {id:1,data:[],title:""},
  389. {id:2,data:[],title:""},
  390. {id:3,data:[],title:""},
  391. {id:4,data:[],title:""},
  392. {id:5,data:[],title:""},
  393. {id:6,data:[],title:""},
  394. {id:7,data:[],title:""},
  395. {id:8,data:[],title:""},
  396. {id:9,data:[],title:""},
  397. {id:10,data:[],title:""},
  398. {id:10,data:[],title:""},
  399. {
  400. id:11,
  401. title:"",
  402. data:[],
  403. data1:[],
  404. data2:[],
  405. data3:[],
  406. data4:[],
  407. category_id1:"",
  408. category_id2:"",
  409. category_id3:"",
  410. category_id4:"",
  411. title1:"",
  412. title2:"",
  413. title3:"",
  414. title4:""
  415. },
  416. {id:12,data1:[],data2:[],data3:[]},
  417. ])
  418. //第一步:获得该分类下的所有二级导航
  419. const newCategory = useState("getWebsiteModelCategory", () => ''); //动态数据
  420. //placeid 固定为1
  421. //pid 由上个页面带过来的1级导航id
  422. //num 获得多少个2级导航 取决你的页面显示 上面有几个你就请求几个
  423. const getWebsiteModelCategory = async () => {
  424. try {
  425. const response = await axios.get(`/web/getWebsiteModelCategory?placeid=${1}&pid=${routeId}&num=${14}`);
  426. pageCategory.value = response.data;
  427. //给与板块标题
  428. for(let index in response.data){
  429. pageData.value[index].title = response.data[index].name
  430. }
  431. console.log(pageData.value)
  432. console.log(pageCategory.value)
  433. renderPage();
  434. } catch (error) {
  435. console.error(error);
  436. }
  437. }
  438. //第二步:获得对应分类下的数据
  439. const renderPage = function(){
  440. console.log("当前获取到:" + pageCategory.value.length + "个导航")
  441. //循环pageCategory.value.length的次数执行getWebsiteArticlesList
  442. for(let i=0;i<=pageCategory.value.length-1;i++){
  443. getWebsiteArticlesList(pageCategory.value[i].category_id,i)
  444. }
  445. }
  446. //第三步循环获取数据
  447. const getWebsiteArticlesList = async (name,listType) => {
  448. //第一层
  449. //板块1 图文
  450. if(listType==0){
  451. const response = await axios.get(`/web/getWebsiteModelArticles?catid=${name}&level=${3}&pagesize=${8}`);
  452. pageData.value[0].data = response.data
  453. const response2 = await axios.get(`/web/getWebsiteModelArticles?catid=${name}&level=${3}&pagesize=${4}&placeid=${9}`);
  454. pageData.value[0].data2 = response2.data
  455. }
  456. //板块2 图文
  457. if(listType==1){
  458. const response = await axios.get(`/web/getWebsiteModelArticles?catid=${name}&level=${3}&pagesize=${5}`);
  459. pageData.value[1].data = response.data;
  460. }
  461. //第二层
  462. //板块3 图文
  463. if(listType==2){
  464. const response = await axios.get(`/web/getWebsiteModelArticles?catid=${name}&level=${3}&pagesize=${6}`);
  465. pageData.value[2].data = response.data;
  466. }
  467. //板块4 图文
  468. if(listType==3){
  469. const response = await axios.get(`/web/getWebsiteModelArticles?catid=${name}&level=${3}&pagesize=${6}`);
  470. pageData.value[3].data = response.data;
  471. }
  472. //板块5 图文
  473. if(listType==4){
  474. const response = await axios.get(`/web/getWebsiteModelArticles?catid=${name}&level=${3}&pagesize=${6}`);
  475. pageData.value[4].data = response.data;
  476. }
  477. //第三层
  478. //板块6 图文
  479. if(listType==5){
  480. const response = await axios.get(`/web/getWebsiteModelArticles?catid=${name}&level=${3}&pagesize=${4}`);
  481. pageData.value[5].data = response.data;
  482. }
  483. //板块7 图文
  484. if(listType==6){
  485. const response = await axios.get(`/web/getWebsiteModelArticles?catid=${name}&level=${3}&pagesize=${5}`);
  486. pageData.value[6].data = response.data;
  487. }
  488. //板块8 图文
  489. if(listType==7){
  490. const response = await axios.get(`/web/getWebsiteModelArticles?catid=${name}&level=${3}&pagesize=${3}`);
  491. pageData.value[7].data = response.data;
  492. }
  493. //板块9 图文
  494. if(listType==8){
  495. const response = await axios.get(`/web/getWebsiteModelArticles?catid=${name}&level=${3}&pagesize=${4}`);
  496. pageData.value[8].data = response.data;
  497. }
  498. //第四层
  499. //板块10 文字
  500. if(listType==9){
  501. const response = await axios.get(`/web/getWebsiteModelArticles?catid=${name}&level=${1}&pagesize=${10}`);
  502. pageData.value[9].data = response.data;
  503. }
  504. //板块11 文字
  505. if(listType==10){
  506. const response = await axios.get(`/web/getWebsiteModelArticles?catid=${name}&level=${1}&pagesize=${10}`);
  507. pageData.value[10].data = response.data;
  508. }
  509. //板块12 轮播图 图文 文字
  510. if(listType==11){
  511. const response = await axios.get(`/web/getWebsiteModelArticles?catid=${name}&level=${2}&pagesize=${4}`);
  512. pageData.value[11].data = response.data;
  513. const response2 = await axios.get(`/web/getWebsiteModelArticles?catid=${name}&level=${3}&pagesize=${2}`);
  514. pageData.value[11].data2 = response2.data;
  515. const response3 = await axios.get(`/web/getWebsiteModelArticles?catid=${name}&level=${1}&pagesize=${5}`);
  516. pageData.value[11].data3 = response3.data;
  517. }
  518. //第五层
  519. //板块12 多级栏目 判断下面有没有子级 如果有每个取出来 6条图文
  520. if(listType==12){
  521. const response = await axios.get(`/web/getWebsiteModelArticles?catid=${name}&level=${3}&pagesize=${10}`);
  522. pageData.value[12].data = response.data;
  523. console.log("第一步获取父级id")
  524. console.log(pageCategory.value[12].children_count)
  525. console.log(pageCategory.value[12].category_id)
  526. //判断一下里面有没有子导航
  527. if(pageCategory.value[12].children_count!=0){
  528. //开始请求子导航
  529. const response = await axios.get(`/web/getWebsiteModelCategory?placeid=${1}&pid=${pageCategory.value[12].category_id}&num=${100}`);
  530. console.log("第二步获取子级数量")
  531. console.log(response.data.length)
  532. //获得标题
  533. //判断里面有几个
  534. for(let i = 1; i<=response.data.length;i ++){
  535. if(i==1){
  536. pageData.value[12].title1=response.data[0].name
  537. pageData.value[12].category_id1=response.data[0].category_id
  538. }
  539. if(i==2){
  540. pageData.value[12].title2=response.data[1].name
  541. pageData.value[12].category_id2=response.data[1].category_id
  542. }
  543. if(i==3){
  544. pageData.value[12].title3=response.data[2].name
  545. pageData.value[12].category_id3=response.data[2].category_id
  546. }
  547. if(i==4){
  548. pageData.value[12].title4=response.data[3].name
  549. pageData.value[12].category_id4=response.data[3].category_id
  550. }
  551. }
  552. //获得内容
  553. //第三步:有几个就循环几次
  554. for(let i = 1;i<=pageCategory.value[12].children_count;i++){
  555. if(i==1){
  556. const response = await axios.get(`/web/getWebsiteModelArticles?catid=${pageData.value[12].category_id1}&level=${3}&pagesize=${6}`);
  557. pageData.value[12].data1=response.data
  558. }
  559. if(i==2){
  560. const response = await axios.get(`/web/getWebsiteModelArticles?catid=${pageData.value[12].category_id2}&level=${3}&pagesize=${6}`);
  561. pageData.value[12].data2=response.data
  562. }
  563. if(i==3){
  564. const response = await axios.get(`/web/getWebsiteModelArticles?catid=${pageData.value[12].category_id3}&level=${3}&pagesize=${6}`);
  565. pageData.value[12].data3=response.data
  566. }
  567. if(i==4){
  568. const response = await axios.get(`/web/getWebsiteModelArticles?catid=${pageData.value[12].category_id4}&level=${3}&pagesize=${6}`);
  569. pageData.value[12].data4=response.data
  570. }
  571. }
  572. }
  573. }
  574. //板块13 轮播图 图文 文字
  575. if(listType==13){
  576. const response = await axios.get(`/web/getWebsiteModelArticles?catid=${name}&level=${2}&pagesize=${4}`);
  577. pageData.value[13].data = response.data;
  578. const response2 = await axios.get(`/web/getWebsiteModelArticles?catid=${name}&level=${3}&pagesize=${2}`);
  579. pageData.value[13].data2 = response2.data;
  580. const response3 = await axios.get(`/web/getWebsiteModelArticles?catid=${name}&level=${1}&pagesize=${5}`);
  581. pageData.value[13].data3 = response3.data;
  582. }
  583. }
  584. let scienceTitleList = [
  585. {
  586. id: 1,
  587. title: "农产畅销"
  588. },
  589. {
  590. id: 2,
  591. title: "农业在线"
  592. },
  593. {
  594. id: 3,
  595. title: "农产行情"
  596. },
  597. {
  598. id: 4,
  599. title: "名优特产"
  600. }
  601. ]
  602. //鼠标移入标题时,下方内容会发生变化
  603. let changeUl = (index) => {
  604. // console.log(index);
  605. if (process.browser) {
  606. let scienceListBox = document.querySelector('.scienceListBox');
  607. let titleList = document.querySelectorAll('.title>span>a')
  608. for (let i = 0; i < titleList.length; i++) {
  609. titleList[i].className = ''
  610. }
  611. titleList[index].setAttribute('class', 'current')
  612. if (index == 0) {
  613. scienceListBox.style.left = 0
  614. } else if (index == 1) {
  615. scienceListBox.style.left = "-790px"
  616. } else if (index == 2) {
  617. scienceListBox.style.left = "-1580px"
  618. } else if (index == 3) {
  619. scienceListBox.style.left = "-2370px"
  620. }
  621. }
  622. }
  623. //显示哪个tabs
  624. let showTabs = ref(1)
  625. let qhtabs = function(number){
  626. console.log(number)
  627. showTabs.value = number
  628. }
  629. //挂载成功钩子函数
  630. onMounted(() => {
  631. //获得所有二级导航
  632. getWebsiteModelCategory()
  633. })
  634. </script>
  635. <style lang="less" scoped>
  636. //农民工part1
  637. .farmingPartOne {
  638. width: 100%;
  639. height: 600px;
  640. .inner {
  641. height: 600px;
  642. .innerLeft {
  643. height: 600px;
  644. .leftTop {
  645. margin-top: 20px;
  646. height: 320px;
  647. .leftTopPhoto {
  648. width: 387px;
  649. height: 320px;
  650. img{
  651. width: 387px;
  652. height: 320px;
  653. }
  654. }
  655. >ul.left {
  656. margin-left: 25px;
  657. width: 362px;
  658. height: 320px;
  659. margin-top: 5px;
  660. >li {
  661. em {
  662. display: inline-block;
  663. width: 8px;
  664. height: 8px;
  665. border-radius: 8px;
  666. background-color: #d9d9d9;
  667. margin-right: 8px;
  668. vertical-align: middle;
  669. }
  670. width: 362px;
  671. height: 22px;
  672. font-family: PingFang SC,
  673. PingFang SC;
  674. font-weight: 500;
  675. font-size: 18px;
  676. color: #333333;
  677. line-height: 22px;
  678. text-align: left;
  679. font-style: normal;
  680. text-transform: none;
  681. margin-bottom: 19px;
  682. white-space: nowrap; /* 禁止换行 */
  683. overflow: hidden; /* 隐藏超出部分 */
  684. text-overflow: ellipsis; /* 超出部分显示省略号 */
  685. }
  686. >li:hover {
  687. color: #088f04;
  688. }
  689. >li:hover>em {
  690. background-color: #088f04;
  691. }
  692. }
  693. }
  694. .leftBottom {
  695. height: 202px;
  696. margin-top: 21px;
  697. >li {
  698. float: left;
  699. width: 185px;
  700. height: 202px;
  701. margin-right: 10px;
  702. >img {
  703. width: 185px;
  704. height: 139px;
  705. }
  706. >p {
  707. width: 185px;
  708. height: 58px;
  709. padding: 8px 5px 12px;
  710. box-sizing: border-box;
  711. background-color: #f5f5f5;
  712. font-family: PingFang SC, PingFang SC;
  713. font-weight: 500;
  714. font-size: 18px;
  715. color: #333333;
  716. line-height: 24px;
  717. text-align: left;
  718. font-style: normal;
  719. text-transform: none;
  720. display: -webkit-box;
  721. -webkit-box-orient: vertical;
  722. -webkit-line-clamp: 2; /* 限制显示的行数 */
  723. overflow: hidden;
  724. text-overflow: ellipsis;
  725. }
  726. }
  727. >li:last-child {
  728. margin: 0;
  729. }
  730. }
  731. }
  732. .innerRight {
  733. .rightList {
  734. height: 540px;
  735. margin-top: 20px;
  736. >li {
  737. height: 100px;
  738. margin-bottom: 10px;
  739. >img {
  740. width: 150px;
  741. height: 100px;
  742. }
  743. >p {
  744. width: 219px;
  745. height: 100px;
  746. padding-left: 12px;
  747. font-family: PingFang SC, PingFang SC;
  748. font-weight: 400;
  749. font-size: 16px;
  750. color: #333333;
  751. line-height: 22px;
  752. text-align: left;
  753. font-style: normal;
  754. text-transform: none;
  755. }
  756. >p:hover {
  757. box-shadow: 0 0 16px 1px rgba(0, 0, 0, 0.1);
  758. }
  759. }
  760. }
  761. }
  762. }
  763. }
  764. //农民工part2
  765. .farmingPartTwo {
  766. width: 100%;
  767. height: 600px;
  768. .inner {
  769. width: 1200px;
  770. height: 600px;
  771. >.farmer {
  772. float: left;
  773. width: 380px;
  774. height: 600px;
  775. margin-right: 29px;
  776. // 农民工part2标题
  777. >.title {
  778. width: 380px;
  779. }
  780. >.title>h3 {
  781. height: 36px;
  782. font-family: Source Han Sans, Source Han Sans;
  783. font-weight: bold;
  784. font-size: 24px;
  785. color: #000000;
  786. line-height: 28px;
  787. text-align: left;
  788. font-style: normal;
  789. text-transform: none;
  790. border-bottom: 1px solid #139602;
  791. }
  792. >.title>h3>span {
  793. float: right;
  794. width: 56px;
  795. height: 20px;
  796. line-height: 24px;
  797. font-weight: 400;
  798. font-size: 14px;
  799. color: #999999;
  800. font-style: normal;
  801. text-transform: none;
  802. }
  803. // 农民工part2图片
  804. .PartTwoPhoto {
  805. width: 380px;
  806. height: 280px;
  807. margin-top: 20px;
  808. position: relative;
  809. img {
  810. width: 380px;
  811. height: 280px;
  812. }
  813. >span {
  814. display: inline-block;
  815. width: 380px;
  816. height: 50px;
  817. background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 1));
  818. color: #FFFFFF;
  819. position: absolute;
  820. bottom: 0;
  821. left: 0;
  822. font-family: Source Han Sans, Source Han Sans;
  823. font-weight: 500;
  824. font-size: 20px;
  825. line-height: 23px;
  826. padding-top: 11px;
  827. padding-left: 13px;
  828. box-sizing: border-box;
  829. white-space: nowrap; /* 禁止换行 */
  830. overflow: hidden; /* 隐藏超出部分 */
  831. text-overflow: ellipsis; /* 超出部分显示省略号 */
  832. }
  833. }
  834. //农民工part2文字列表
  835. .PartTwoList {
  836. width: 380px;
  837. height: 263px;
  838. background-color: #fff;
  839. box-shadow: 0px 4px 30px 1px rgba(174, 174, 174, 0.25);
  840. padding-top: 20px;
  841. box-sizing: border-box;
  842. >li {
  843. width: 380px;
  844. height: 25px;
  845. line-height: 25px;
  846. font-family: PingFang SC, PingFang SC;
  847. font-weight: 500;
  848. font-size: 18px;
  849. color: #333333;
  850. margin-bottom: 16px;
  851. white-space: nowrap; /* 禁止换行 */
  852. overflow: hidden; /* 隐藏超出部分 */
  853. text-overflow: ellipsis; /* 超出部分显示省略号 */
  854. >em {
  855. display: inline-block;
  856. width: 8px;
  857. height: 8px;
  858. background-color: #d9d9d9;
  859. border-radius: 8px;
  860. margin-left: 19px;
  861. margin-right: 10px;
  862. }
  863. }
  864. >li:hover {
  865. color: #139602;
  866. }
  867. >li:hover>em {
  868. background-color: #139602;
  869. }
  870. }
  871. }
  872. >.farmer:last-child {
  873. margin-right: 0;
  874. }
  875. }
  876. }
  877. //资讯推荐
  878. .zixuntuijian {
  879. width: 100%;
  880. height: 600px;
  881. .innerLeft {
  882. // 左侧的上半部分
  883. .zixunTop {
  884. height: 286px;
  885. .zixunLeft,
  886. .zixunRight {
  887. float: left;
  888. width: 380px;
  889. height: 286px;
  890. .towPic {
  891. display: flex;
  892. width: 380px;
  893. height: 116px;
  894. margin-top: 20px;
  895. .picBox {
  896. width: 50%;
  897. text-align: center;
  898. }
  899. .picBox:nth-child(3),.picBox:nth-child(4),.picBox:nth-child(5){
  900. display: none;
  901. }
  902. img {
  903. width: 190px;
  904. height: 120px;
  905. }
  906. }
  907. // 标题部分
  908. >.title {
  909. width: 380px;
  910. }
  911. >.title>h3 {
  912. height: 36px;
  913. font-family: Source Han Sans, Source Han Sans;
  914. font-weight: bold;
  915. font-size: 24px;
  916. color: #000000;
  917. line-height: 28px;
  918. text-align: left;
  919. font-style: normal;
  920. text-transform: none;
  921. border-bottom: 1px solid #139602;
  922. }
  923. >.title>h3>span {
  924. float: right;
  925. width: 56px;
  926. height: 20px;
  927. line-height: 24px;
  928. font-weight: 400;
  929. font-size: 14px;
  930. color: #999999;
  931. font-style: normal;
  932. text-transform: none;
  933. }
  934. .photo_text {
  935. article {
  936. white-space: nowrap; /* 禁止换行 */
  937. overflow: hidden; /* 隐藏超出部分 */
  938. text-overflow: ellipsis; /* 超出部分显示省略号 */
  939. li {
  940. white-space: nowrap; /* 禁止换行 */
  941. overflow: hidden; /* 隐藏超出部分 */
  942. text-overflow: ellipsis; /* 超出部分显示省略号 */
  943. }
  944. img {
  945. width: 100px;
  946. }
  947. }
  948. li {
  949. width: 380px;
  950. height: 25px;
  951. font-family: PingFang SC, PingFang SC;
  952. font-weight: 500;
  953. font-size: 18px;
  954. color: #333333;
  955. line-height: 21px;
  956. text-align: left;
  957. font-style: normal;
  958. text-transform: none;
  959. margin-bottom: 9px;
  960. em {
  961. display: inline-block;
  962. width: 8px;
  963. height: 8px;
  964. border-radius: 8px;
  965. margin-right: 10px;
  966. background-color: #d9d9d9;
  967. }
  968. }
  969. }
  970. }
  971. // 左侧的资讯推荐的左半部分
  972. .zixunLeft {
  973. margin-right: 30px;
  974. .photo_text {
  975. li:first-child {
  976. width: 380px;
  977. height: 120px;
  978. margin-top: 20px;
  979. margin-bottom: 16px;
  980. position: relative;
  981. img {
  982. float: left;
  983. width: 160px;
  984. height: 120px;
  985. }
  986. div {
  987. float: left;
  988. width: 220px;
  989. height: 120px;
  990. padding-left: 15px;
  991. padding-top: 6px;
  992. box-sizing: border-box;
  993. background-color: #f6f6f6;
  994. h5 {
  995. height: 54px;
  996. font-family: Source Han Sans, Source Han Sans;
  997. font-weight: 500;
  998. font-size: 18px;
  999. color: #333333;
  1000. line-height: 26px;
  1001. text-align: left;
  1002. font-style: normal;
  1003. text-transform: none;
  1004. }
  1005. p {
  1006. width: 200px;
  1007. height: 22px;
  1008. line-height: 20px;
  1009. position: absolute;
  1010. bottom: 5px;
  1011. right: 0;
  1012. span {
  1013. display: inline-block;
  1014. width: 100px;
  1015. height: 18px;
  1016. font-family: Source Han Sans, Source Han Sans;
  1017. font-weight: 400;
  1018. font-size: 12px;
  1019. color: #999999;
  1020. text-align: left;
  1021. line-height: 14px;
  1022. font-style: normal;
  1023. text-transform: none;
  1024. }
  1025. span:last-child {
  1026. width: 90px;
  1027. text-align: right;
  1028. }
  1029. }
  1030. }
  1031. }
  1032. >li {
  1033. width: 380px;
  1034. height: 25px;
  1035. font-family: PingFang SC, PingFang SC;
  1036. font-weight: 500;
  1037. font-size: 18px;
  1038. color: #333333;
  1039. line-height: 21px;
  1040. text-align: left;
  1041. font-style: normal;
  1042. text-transform: none;
  1043. margin-bottom: 9px;
  1044. em {
  1045. display: inline-block;
  1046. width: 8px;
  1047. height: 8px;
  1048. border-radius: 8px;
  1049. margin-right: 10px;
  1050. background-color: #d9d9d9;
  1051. }
  1052. }
  1053. }
  1054. }
  1055. // 左侧的资讯推荐的右半部分
  1056. .zixunRight {
  1057. width: 380px;
  1058. height: 229px;
  1059. .photo_text {
  1060. margin-top: 20px;
  1061. >li:nth-child(1) {
  1062. display: none;
  1063. }
  1064. >li:nth-child(2) {
  1065. display: none;
  1066. }
  1067. }
  1068. }
  1069. }
  1070. //左侧的下半部分
  1071. .zixunBottom {
  1072. width: 790px;
  1073. height: 280px;
  1074. margin-top: 40px;
  1075. img {
  1076. width: 498px;
  1077. height: 280px;
  1078. }
  1079. >.leftList {
  1080. width: 290px;
  1081. height: 280px;
  1082. background-color: #f6f6f6;
  1083. padding: 11px 26px 6px 20px;
  1084. box-sizing: border-box;
  1085. >li {
  1086. width: 296px;
  1087. height: 75px;
  1088. color: #666666;
  1089. font-size: 14px;
  1090. margin-bottom: 18px;
  1091. h4 {
  1092. font-family: Source Han Sans, Source Han Sans;
  1093. height: 27px;
  1094. line-height: 21px;
  1095. font-size: 18px;
  1096. white-space: nowrap; /* 禁止换行 */
  1097. overflow: hidden; /* 隐藏超出部分 */
  1098. text-overflow: ellipsis; /* 超出部分显示省略号 */
  1099. color: #333333;
  1100. width: 280px;
  1101. em {
  1102. display: inline-block;
  1103. width: 8px;
  1104. height: 8px;
  1105. background-color: #333333;
  1106. border-radius: 8px;
  1107. }
  1108. }
  1109. p {
  1110. width: 249px;
  1111. height: 48px;
  1112. line-height: 24px;
  1113. padding-left: 14px;
  1114. display: -webkit-box;
  1115. -webkit-box-orient: vertical;
  1116. -webkit-line-clamp: 3; /* 限制显示的行数 */
  1117. overflow: hidden;
  1118. text-overflow: ellipsis;
  1119. }
  1120. }
  1121. >li:hover,
  1122. >li:hover>h4 {
  1123. color: #088f04;
  1124. }
  1125. >li:hover>h4>em {
  1126. background-color: #088f04;
  1127. }
  1128. }
  1129. }
  1130. }
  1131. .innerRight {
  1132. .information {
  1133. width: 380px;
  1134. margin-top: 20px;
  1135. >li {
  1136. width: 380px;
  1137. height: 120px;
  1138. margin-bottom: 21px;
  1139. img {
  1140. float: left;
  1141. width: 160px;
  1142. height: 120px;
  1143. }
  1144. .text {
  1145. float: left;
  1146. width: 220px;
  1147. height: 120px;
  1148. padding-left: 15px;
  1149. box-sizing: border-box;
  1150. >h5 {
  1151. width: 199px;
  1152. height: 43px;
  1153. padding-top: 6px;
  1154. font-family: PingFang SC, PingFang SC;
  1155. font-weight: 600;
  1156. font-size: 18px;
  1157. color: #333333;
  1158. line-height: 26px;
  1159. text-align: left;
  1160. font-style: normal;
  1161. text-transform: none;
  1162. }
  1163. >p {
  1164. width: 198px;
  1165. height: 46px;
  1166. margin-top: 16px;
  1167. font-family: PingFang SC, PingFang SC;
  1168. font-weight: 400;
  1169. font-size: 14px;
  1170. color: #666666;
  1171. line-height: 24px;
  1172. text-align: left;
  1173. font-style: normal;
  1174. text-transform: none;
  1175. }
  1176. }
  1177. .text:hover {
  1178. box-shadow: 0 0 16px 1px rgba(0, 0, 0, 0.1);
  1179. background-color: #fff;
  1180. }
  1181. }
  1182. }
  1183. }
  1184. }
  1185. // 农民工
  1186. .farming {
  1187. width: 100%;
  1188. height: 605px;
  1189. // 左侧
  1190. .innerLeft {
  1191. width: 790px;
  1192. height: 605px;
  1193. margin-right: 21px;
  1194. // background-color: #ccc;
  1195. .farmer {
  1196. width: 790px;
  1197. height: 312px;
  1198. >h3 {
  1199. height: 36px;
  1200. font-family: Source Han Sans, Source Han Sans;
  1201. font-weight: bold;
  1202. font-size: 24px;
  1203. color: #000000;
  1204. line-height: 28px;
  1205. text-align: left;
  1206. font-style: normal;
  1207. text-transform: none;
  1208. border-bottom: 1px solid #139602;
  1209. >span {
  1210. float: right;
  1211. width: 56px;
  1212. height: 20px;
  1213. line-height: 24px;
  1214. font-weight: 400;
  1215. font-size: 14px;
  1216. color: #999999;
  1217. font-style: normal;
  1218. text-transform: none;
  1219. }
  1220. }
  1221. >ul {
  1222. margin-top: 20px;
  1223. >li {
  1224. float: left;
  1225. width: 362px;
  1226. height: 22px;
  1227. font-weight: 500;
  1228. font-size: 18px;
  1229. color: #333333;
  1230. line-height: 21px;
  1231. text-align: left;
  1232. margin-bottom: 29px;
  1233. margin-right: 27px;
  1234. white-space: nowrap; /* 禁止换行 */
  1235. overflow: hidden; /* 隐藏超出部分 */
  1236. text-overflow: ellipsis; /* 超出部分显示省略号 */
  1237. >em {
  1238. display: inline-block;
  1239. width: 8px;
  1240. height: 8px;
  1241. background-color: #d9d9d9;
  1242. border-radius: 4px;
  1243. margin: 5px 8px 6px;
  1244. vertical-align: middle;
  1245. }
  1246. }
  1247. >li:hover {
  1248. color: #139602;
  1249. }
  1250. }
  1251. }
  1252. .farmerbottom {
  1253. width: 790px;
  1254. height: 280px;
  1255. img {
  1256. width: 498px;
  1257. height: 280px;
  1258. }
  1259. >.leftList {
  1260. width: 290px;
  1261. height: 280px;
  1262. background-color: #f6f6f6;
  1263. padding: 11px 26px 6px 20px;
  1264. box-sizing: border-box;
  1265. >li {
  1266. width: 296px;
  1267. height: 75px;
  1268. color: #666666;
  1269. font-size: 14px;
  1270. margin-bottom: 18px;
  1271. h4 {
  1272. font-family: Source Han Sans, Source Han Sans;
  1273. height: 27px;
  1274. line-height: 21px;
  1275. font-size: 18px;
  1276. color: #333333;
  1277. em {
  1278. display: inline-block;
  1279. width: 8px;
  1280. height: 8px;
  1281. background-color: #333333;
  1282. border-radius: 8px;
  1283. }
  1284. }
  1285. p {
  1286. width: 249px;
  1287. height: 48px;
  1288. line-height: 24px;
  1289. padding-left: 14px;
  1290. }
  1291. }
  1292. >li:hover,
  1293. >li:hover>h4 {
  1294. color: #088f04;
  1295. }
  1296. >li:hover>h4>em {
  1297. background-color: #088f04;
  1298. }
  1299. }
  1300. }
  1301. }
  1302. // 右侧
  1303. .innerRight {
  1304. width: 380px;
  1305. height: 605px;
  1306. // 标题部分
  1307. >h3 {
  1308. height: 36px;
  1309. font-family: Source Han Sans, Source Han Sans;
  1310. font-weight: bold;
  1311. font-size: 24px;
  1312. color: #000000;
  1313. line-height: 28px;
  1314. text-align: left;
  1315. font-style: normal;
  1316. text-transform: none;
  1317. border-bottom: 1px solid #139602;
  1318. >span {
  1319. float: right;
  1320. width: 56px;
  1321. height: 20px;
  1322. line-height: 24px;
  1323. font-weight: 400;
  1324. font-size: 14px;
  1325. color: #999999;
  1326. font-style: normal;
  1327. text-transform: none;
  1328. }
  1329. }
  1330. // 轮播图
  1331. .banner {
  1332. width: 380px;
  1333. height: 214px;
  1334. margin-top: 20px;
  1335. }
  1336. .banner_b_img {
  1337. // 图片部分
  1338. .photo {
  1339. height: 104px;
  1340. margin-top: 10px;
  1341. display: flex;
  1342. }
  1343. .photoL,
  1344. .photoR {
  1345. float: left;
  1346. width: 185px;
  1347. height: 104px;
  1348. position: relative;
  1349. img {
  1350. width: 185px;
  1351. height: 104px;
  1352. }
  1353. span {
  1354. position: absolute;
  1355. top: 0;
  1356. left: 0;
  1357. display: inline-block;
  1358. padding-left: 7px;
  1359. box-sizing: border-box;
  1360. width: 185px;
  1361. height: 22px;
  1362. background-color: rgba(0, 0, 0, 0.5);
  1363. font-weight: 500px;
  1364. font-size: 14px;
  1365. color: #FFFFFF;
  1366. line-height: 22px;
  1367. white-space: nowrap; /* 禁止换行 */
  1368. overflow: hidden; /* 隐藏超出部分 */
  1369. text-overflow: ellipsis; /* 超出部分显示省略号 */
  1370. }
  1371. }
  1372. .photoL {
  1373. margin-right: 10px;
  1374. }
  1375. }
  1376. .banner_text_list {
  1377. ul {
  1378. width: 380px;
  1379. height: 186px;
  1380. margin-top: 30px;
  1381. >li {
  1382. height: 22px;
  1383. padding-bottom: 16px;
  1384. white-space: nowrap; /* 禁止换行 */
  1385. overflow: hidden; /* 隐藏超出部分 */
  1386. text-overflow: ellipsis; /* 超出部分显示省略号 */
  1387. >strong {
  1388. display: inline-block;
  1389. width: 24px;
  1390. height: 24px;
  1391. line-height: 24px;
  1392. background-color: #cecece;
  1393. padding-left: 6px;
  1394. box-sizing: border-box;
  1395. font-family: Source Han Sans, Source Han Sans;
  1396. font-weight: 500;
  1397. font-size: 18px;
  1398. color: #FFFFFF;
  1399. font-style: normal;
  1400. text-transform: none;
  1401. }
  1402. >em {
  1403. display: inline-block;
  1404. width: 10px;
  1405. height: 10px;
  1406. border-radius: 10px;
  1407. border: 2px solid #8CBA86;
  1408. margin-right: 10px;
  1409. }
  1410. >span {
  1411. width: 380px;
  1412. height: 22px;
  1413. font-family: PingFang SC, PingFang SC;
  1414. font-weight: 500;
  1415. font-size: 18px;
  1416. color: #333333;
  1417. line-height: 21px;
  1418. text-align: left;
  1419. font-style: normal;
  1420. text-transform: none;
  1421. }
  1422. >span:hover {
  1423. color: #139609;
  1424. }
  1425. }
  1426. }
  1427. }
  1428. }
  1429. }
  1430. //三农科教
  1431. .scienceEducation {
  1432. height: 600px;
  1433. margin-bottom: 76px;
  1434. .innerLeft,
  1435. .innerRight {
  1436. float: left;
  1437. }
  1438. // 左侧
  1439. .innerLeft {
  1440. width: 790px;
  1441. height: 616px;
  1442. margin-right: 21px;
  1443. }
  1444. // 右侧
  1445. .innerRight {
  1446. width: 380px;
  1447. height: 600px;
  1448. // 标题部分
  1449. >h3 {
  1450. height: 36px;
  1451. font-family: Source Han Sans, Source Han Sans;
  1452. font-weight: bold;
  1453. font-size: 24px;
  1454. color: #000000;
  1455. line-height: 28px;
  1456. text-align: left;
  1457. font-style: normal;
  1458. text-transform: none;
  1459. border-bottom: 1px solid #139602;
  1460. >span {
  1461. float: right;
  1462. width: 56px;
  1463. height: 20px;
  1464. line-height: 24px;
  1465. font-weight: 400;
  1466. font-size: 14px;
  1467. color: #999999;
  1468. font-style: normal;
  1469. text-transform: none;
  1470. }
  1471. }
  1472. ul.sannongList {
  1473. width: 380px;
  1474. height: 186px;
  1475. >li {
  1476. height: 22px;
  1477. padding-top: 16px;
  1478. white-space: nowrap; /* 禁止换行 */
  1479. overflow: hidden; /* 隐藏超出部分 */
  1480. text-overflow: ellipsis; /* 超出部分显示省略号 */
  1481. >strong {
  1482. display: inline-block;
  1483. width: 24px;
  1484. height: 24px;
  1485. line-height: 24px;
  1486. background-color: #cecece;
  1487. padding-left: 6px;
  1488. box-sizing: border-box;
  1489. font-family: Source Han Sans, Source Han Sans;
  1490. font-weight: 500;
  1491. font-size: 18px;
  1492. color: #FFFFFF;
  1493. font-style: normal;
  1494. text-transform: none;
  1495. }
  1496. >em {
  1497. display: inline-block;
  1498. width: 10px;
  1499. height: 10px;
  1500. border-radius: 10px;
  1501. border: 2px solid #8CBA86;
  1502. }
  1503. >span {
  1504. width: 380px;
  1505. height: 22px;
  1506. font-family: PingFang SC, PingFang SC;
  1507. font-weight: 500;
  1508. font-size: 18px;
  1509. color: #333333;
  1510. line-height: 21px;
  1511. text-align: left;
  1512. font-style: normal;
  1513. text-transform: none;
  1514. padding-left: 9px;
  1515. }
  1516. >span:hover {
  1517. color: #139609;
  1518. }
  1519. }
  1520. }
  1521. // 轮播图
  1522. .banner {
  1523. width: 380px;
  1524. height: 214px;
  1525. margin-top: 45px;
  1526. }
  1527. .banner_b_img {
  1528. // 图片部分
  1529. .photo {
  1530. height: 104px;
  1531. margin-top: 10px;
  1532. display:flex;
  1533. }
  1534. .photoL,
  1535. .photoR {
  1536. float: left;
  1537. width: 185px;
  1538. height: 104px;
  1539. position: relative;
  1540. img {
  1541. width: 185px;
  1542. height: 104px;
  1543. }
  1544. span {
  1545. position: absolute;
  1546. top: 0;
  1547. left: 0;
  1548. display: inline-block;
  1549. padding-left: 7px;
  1550. box-sizing: border-box;
  1551. width: 185px;
  1552. height: 22px;
  1553. background-color: rgba(0, 0, 0, 0.5);
  1554. font-weight: 500px;
  1555. font-size: 14px;
  1556. color: #FFFFFF;
  1557. line-height: 22px;
  1558. white-space: nowrap; /* 禁止换行 */
  1559. overflow: hidden; /* 隐藏超出部分 */
  1560. text-overflow: ellipsis; /* 超出部分显示省略号 */
  1561. }
  1562. }
  1563. .photoL {
  1564. margin-right: 10px;
  1565. }
  1566. }
  1567. }
  1568. }
  1569. // 标题
  1570. .scienceTitle {
  1571. height: 37px;
  1572. h5 {
  1573. float: left;
  1574. width: 96px;
  1575. height: 34px;
  1576. font-family: PingFang SC, PingFang SC;
  1577. font-weight: 600;
  1578. font-size: 24px;
  1579. color: #000000;
  1580. line-height: 28px;
  1581. text-align: left;
  1582. font-style: normal;
  1583. text-transform: none;
  1584. margin-right: 20px;
  1585. }
  1586. >p {
  1587. float: left;
  1588. height: 37px;
  1589. line-height: 30px;
  1590. >span {
  1591. display: inline-block;
  1592. //height: 20px;
  1593. line-height: 20px;
  1594. text-align: center;
  1595. margin: 4px 0px 3px;
  1596. padding: 0 20px;
  1597. //border-right: 1px solid #ccc;
  1598. font-weight: 500;
  1599. font-size: 20px;
  1600. cursor: pointer;
  1601. padding-bottom: 11px;
  1602. // >a {
  1603. // display: inline-block;
  1604. // padding-bottom: 11px;
  1605. // font-family: PingFang SC, PingFang SC;
  1606. // font-weight: 500;
  1607. // font-size: 20px;
  1608. // color: #666666;
  1609. // line-height: 20px;
  1610. // font-style: normal;
  1611. // text-transform: none;
  1612. // box-sizing: border-box;
  1613. // }
  1614. .current {
  1615. color: #139602;
  1616. border-bottom: 1px solid #139602;
  1617. }
  1618. }
  1619. >span:nth-child(4) {
  1620. border-right: none;
  1621. }
  1622. >span:hover>a {
  1623. color: #139602;
  1624. border-bottom: 1px solid #139602;
  1625. }
  1626. }
  1627. }
  1628. .box {
  1629. width: 790px;
  1630. height: 570px;
  1631. position: relative;
  1632. overflow: hidden;
  1633. }
  1634. .fade-in{
  1635. animation: fadeIn 1s ease-in-out;
  1636. }
  1637. .fade-enter-from,
  1638. .fade-leave-to {
  1639. opacity: 0;
  1640. }
  1641. .fade-enter-to,
  1642. .fade-leave-from {
  1643. opacity: 1;
  1644. }
  1645. .fade-enter-active,
  1646. .fade-leave-active {
  1647. transition: opacity 1s ease;
  1648. }
  1649. .scienceListBox {
  1650. width: 3160px;
  1651. height: 570px;
  1652. position: absolute;
  1653. top: 0;
  1654. left: 0;
  1655. transition: all 3s linear 0;
  1656. }
  1657. // 标题下列表
  1658. .scienceList {
  1659. width: 790px;
  1660. height: 570px;
  1661. float: left;
  1662. margin-top: 17px;
  1663. >li {
  1664. width: 250px;
  1665. height: 276px;
  1666. float: left;
  1667. margin-right: 20px;
  1668. position: relative;
  1669. >img {
  1670. width: 250px;
  1671. height: 220px;
  1672. }
  1673. >p {
  1674. height: 56px;
  1675. width: 248px;
  1676. font-family: PingFang SC, PingFang SC;
  1677. font-weight: 600;
  1678. font-size: 18px;
  1679. color: #333333;
  1680. line-height: 24px;
  1681. text-align: left;
  1682. font-style: normal;
  1683. text-transform: none;
  1684. display: -webkit-box;
  1685. -webkit-box-orient: vertical;
  1686. -webkit-line-clamp: 2; /* 限制显示的行数 */
  1687. overflow: hidden;
  1688. text-overflow: ellipsis;
  1689. }
  1690. >p:hover {
  1691. color: #139602;
  1692. }
  1693. }
  1694. >li:nth-child(3),
  1695. >li:nth-child(6) {
  1696. margin-right: 0;
  1697. }
  1698. >li::before {
  1699. content: "";
  1700. display: inline-block;
  1701. width: 40px;
  1702. height: 20px;
  1703. position: absolute;
  1704. top: 0;
  1705. right: 0;
  1706. background-image: url("../../static/images/Component 209.png");
  1707. }
  1708. }
  1709. </style>